﻿using CommunityToolkit.Mvvm.Input;
using dpa.Library.Models;
using dpa.Library.Services;

namespace dpa.Library.ViewModels;

public partial class TodayDetailViewModel(IMenuNavigationService menuNavigationService) : ViewModelBase
{
    private TodayPoetry _todayPoetry;

    public TodayPoetry TodayPoetry
    {
        get => _todayPoetry;
        private set => SetProperty(ref _todayPoetry, value);
    }

    public override void SetParameter(object parameter)
    {
        TodayPoetry = parameter as TodayPoetry;
    }

    [RelayCommand]
    private void Query() =>
        menuNavigationService.NavigateTo(MenuNavigationConstant.QueryView,
            new PoetryQuery
            {
                Author = TodayPoetry.Author, Name = TodayPoetry.Name
            });
}